Conversation
Co-authored-by: cvraut <10603882+cvraut@users.noreply.github.com>
Co-authored-by: cvraut <10603882+cvraut@users.noreply.github.com>
…dency Copilot/remove pkg resources dependency merging into dev to allow for testing. Note, in the future PR's should be made to dev first. Branch rules disallow automated testing on branches other than dev and main to protect the webhook test urls.
…314 as other python versions to check against
…d tests to work on windows with python3.6
…t good runners from yml workflow
…s can actually see it now
…exposed to the test environment
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
cvraut
left a comment
There was a problem hiding this comment.
PR Overview (from copilot review)
This PR releases whecho v0.0.6, updating version resolution away from deprecated pkg_resources and improving Discord webhook URL handling to support both discord.com and discordapp.com.
Changes:
- Replace
pkg_resourceswithimportlib.metadata/importlib_metadatafor version lookup (Python 3.6+ compatible). - Treat
discordapp.comwebhook URLs the same asdiscord.comin payload selection; add early input validation for missing URL/message. - Update CI/test plumbing: add
TEST_DISCORD_URL, modernize tox config, expand GitHub Actions matrix, and add/extend tests.
Reviewed Changes
| File | Description |
|---|---|
| whecho/whecho.py | Makes CLI description emoji conditional on UTF-8 stdout encoding. |
| whecho/_utilities.py | Uses importlib.metadata for --version behavior. |
| whecho/_send_message.py | Adds URL/message validation and supports discordapp.com URL detection. |
| whecho/_config.py | Uses importlib.metadata to populate default config version. |
| whecho/README.md | Documents contribution flow and adds TEST_DISCORD_URL to test setup. |
| tox.ini | Enables isolated builds, passes TEST_DISCORD_URL, sets PYTHONIOENCODING. |
| tests/test_whecho_simple.py | Adds Discord integration test and empty-URL error test. |
| tests/test_post_message.py | Adds unit tests for missing URL/message validation. |
| tests/test_auto_machine.py | Removes unused import. |
| pyproject.toml | Bumps version to 0.0.6 and adds importlib-metadata for Python < 3.8. |
| .github/workflows/pytest.yml | Adds TEST_DISCORD_URL and expands OS/Python test matrix. |
This PR updates whecho to version 0.0.6. It modernizes treatment of version handling and discord webhooks.
Recently discord has updated their webhook generator to also append
appat the end of the url. This PR not only checks for the presence of discord.com but also discordapp.com in the webhook url to determine how to handle the request. This will take care of #21.pkg_resources is now depreciated. This PR uses
importlib.metadatainstead to get the version number for whecho. This should silence the warning present with #16.For development work, github has depreciated most of the python 3.6 runners, such as the windows-2019 runner. This PR switches the windows runner to the windows-2022 runner to maintain python 3.6 test coverage. It also adds a new test case to
test_whecho_simple.pyto cover the edge case for #21.